/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sdc.utility;

/**
 *
 * @author yokoe
 */
public class Pair<A, B> {

	private A first;
	private B second;


	public Pair(A first, B second)
	{
		this.first = first;
		this.second = second;
	}

	/**
	 * @return the first
	 */
	public A getFirst() {
		return first;
	}

	/**
	 * @param first the first to set
	 */
	public void setFirst(A first) {
		this.first = first;
	}

	/**
	 * @return the second
	 */
	public B getSecond() {
		return second;
	}

	/**
	 * @param second the second to set
	 */
	public void setSecond(B second) {
		this.second = second;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Pair other = (Pair) obj;
		if (this.getFirst().equals(other.getFirst()) == false || this.getSecond().equals(other.getSecond()) == false)
			return false;
		return true;
	}

	@Override
	public int hashCode() {
		int hash = 3;
		hash = 97 * hash + this.getFirst().hashCode() + this.getSecond().hashCode();
		return hash;
	}


}
